<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /* Math.ceil()  上取整
           Math.floor()  下取整
           Math.round()    四舍五入取整
         */
        var a=12.54;
        console.log(Math.ceil(a))   //13
        console.log(Math.floor(a))  //12
        console.log(Math.round(a))  //13
    </script>
</body>
</html>